import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 高生平
 * Date: 2025-09-17
 * Time: 19:59
 */

//采用封装的思想，为Person类定义年龄属性，要求：
//修改年龄时判断其范围，若年龄小于0则按0输出，若年龄大于200则按200输出。若年龄介于[0,200]之间则直接输出。
public class Main {
    public static void main(String[] args) {
        Person p = new Person();
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int age = scanner.nextInt();
            p.setAge(age);
            System.out.println(p.getAge());
        }
    }
}

class Person {

    private int age;

    //write your code here......
    public void setAge (int age) {
        this.age = age;
    }

    public int getAge () {
        if (this.age < 0) {
            return 0;
        } else if (this.age > 200) {
            return 200;
        }
        return this.age;
    }
}
